package com.tao.lab.bitmaprecycle;

import java.util.Iterator;
import java.util.TreeMap;

/**
 * @ProjectName: lab
 * @Package: com.tao.lab.bitmaprecycle
 * @ClassName: PrettyPrintTreeMap
 * @Description: java类作用描述
 * @Author: wangxf
 * @CreateDate: 2022/5/26 9:28
 * @UpdateUser: 更新者
 * @UpdateDate: 2022/5/26 9:28
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
class PrettyPrintTreeMap<K, V> extends TreeMap<K, V> {
    PrettyPrintTreeMap() {
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("( ");
        Iterator i$ = this.entrySet().iterator();

        while(i$.hasNext()) {
            Entry<K, V> entry = (Entry)i$.next();
            sb.append('{').append(entry.getKey()).append(':').append(entry.getValue()).append("}, ");
        }

        if (!this.isEmpty()) {
            sb.replace(sb.length() - 2, sb.length(), "");
        }

        return sb.append(" )").toString();
    }
}
